package com.pro.controller;

import com.pro.pojo.JsBeforeUser;
import com.pro.pojo.JsUserDevelopment;
import com.pro.pojo.JsonData;
import com.pro.service.JsUserDevelopmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/JsUserDevelopment")
public class JsUserDevelopmentController {

    @Autowired
    private JsUserDevelopmentService jdl;

    //查看进思用户
    @RequestMapping("/getJsUserDevelopment")
    @ResponseBody
    public JsonData getJsUserDevelopment(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> jsUserDevelopment = jdl.getJsUserDevelopment(jsBeforeUser);
        return jsUserDevelopment!=null?JsonData.buildSuccess(jsUserDevelopment):JsonData.buildError("服务器出错了");
    }

    //进思用户高级检索
    @RequestMapping("/getJsUserDevelopmentRetrieval")
    @ResponseBody
    public JsonData getJsUserDevelopmentRetrieval(JsBeforeUser jsBeforeUser){
        List<JsBeforeUser> jsUserDevelopment = jdl.getJsUserDevelopmentRetrieval(jsBeforeUser);
        return jsUserDevelopment!=null?JsonData.buildSuccess(jsUserDevelopment):JsonData.buildError("服务器出错了");
    }

    //修改毕业状态
    @RequestMapping("/updateJsUserDevelopmentType")
    @ResponseBody
    public JsonData updateJsUserDevelopmentType(JsBeforeUser jsBeforeUser){
        boolean b = jdl.updateJsUserDevelopmentType(jsBeforeUser);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

    //修改进思用户信息
    @RequestMapping("/updateJsUserDevelopment")
    @ResponseBody
    public JsonData updateJsUserDevelopment(JsUserDevelopment jsUserDevelopment){
        boolean b = jdl.updateJsUserDevelopment(jsUserDevelopment);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

    //修改进思用户信息
    @RequestMapping("/updateJsBeforeUser")
    @ResponseBody
    public JsonData updateJsBeforeUser(JsBeforeUser jsBeforeUser){
        boolean b = jdl.updateJsBeforeUser(jsBeforeUser);
        return b?JsonData.buildSuccess(b):JsonData.buildError("服务器出错了");
    }

}
